What is @types/aria-query?
The @types/aria-query package provides TypeScript type definitions for aria-query, a library that maps ARIA roles, states, and properties to their respective values and types. This package is essential for developers using TypeScript to build accessible web applications, ensuring type safety and autocomplete features for ARIA-related code.
What are @types/aria-query's main functionalities?
Type Definitions for ARIA Roles
Provides TypeScript types for querying details about ARIA roles, such as 'button', 'checkbox', etc., including their required states and properties.
import { ARIARoleDefintionMap } from 'aria-query';
const roleMap: ARIARoleDefintionMap = require('aria-query').roles;
console.log(roleMap['button']);
Type Definitions for ARIA States and Properties
Offers TypeScript types for ARIA states and properties, enabling developers to access information about each state or property, such as type, values, and applicability.
import { ARIAStateMap } from 'aria-query';
const stateMap: ARIAStateMap = require('aria-query').states;
console.log(stateMap['aria-checked']);
Other packages similar to @types/aria-query
@types/react
Provides TypeScript definitions for React, similar to how @types/aria-query provides for aria-query. While @types/react focuses on React-specific types, @types/aria-query focuses on ARIA roles, states, and properties for accessibility.
typescript
The core TypeScript language itself, which includes support for JSX and other typing features. TypeScript enhances JavaScript with types and is similar to @types/aria-query in that it provides type safety, but it is more general and not focused solely on ARIA attributes.